package vip.xiaonuo.device.modular.controller;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import vip.xiaonuo.device.modular.service.BizBannerService;
import vip.xiaonuo.device.vo.BizBannerVO;
import vip.xiaonuo.device.vo.CabinetInfoVO;
import vip.xiaonuo.device.vo.Result;

import javax.annotation.Resource;

/**
 * @author 墨塵
 * @since 2023/2/22
 */
@Slf4j
@Api(value = "轮播图", tags = {"轮播图相关接口"})
@ApiSupport(author = "kongxm", order = 1)
@RestController
@Validated
@RequestMapping("/api/banner")
public class DeviceBannerController {

    @Resource
    private BizBannerService bizBannerService;

    @ApiOperationSupport(order = 1)
    @GetMapping("/list")
    @ApiOperation(value = "轮播图列表", notes = "参数:type 1-h5 2-柜子屏", response = BizBannerVO.class)
    public Result queryCabinetList(Integer type) {
        return Result.ok(bizBannerService.getListByType(type));
    }
}
